package jtg.state;

import com.microsoft.z3.BoolExpr;
import com.microsoft.z3.Expr;
import com.microsoft.z3.Solver;
import soot.Unit;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class PathState {
    public List<BoolExpr> PathConstraints;

    public Map<String, Expr> params;

    public Map<String, Integer> paramLatestMap;

    public Unit node;


    public List<Unit> unitPath;

    public PathState(List<BoolExpr> pathConstraints,
                     Map<String, Expr> params,
                     Map<String, Integer> paramLatestMap,
                     Unit node,
                     List<Unit> unitPath
    ) {
        PathConstraints = pathConstraints;
        this.params = params;
        this.paramLatestMap = paramLatestMap;
        this.node = node;
        this.unitPath = unitPath;
    }

    public PathState(PathState pathState){
        // 复制一下 pathState
        this.PathConstraints = new ArrayList<>(pathState.PathConstraints);
        this.params = new HashMap<>(pathState.params);
        this.paramLatestMap = new HashMap<>(pathState.paramLatestMap);
        this.node = pathState.node;
        this.unitPath = new ArrayList<>(pathState.unitPath);
    }

    public PathState(Unit node) {
        PathConstraints = new ArrayList<>();
        params = new HashMap<>();
        paramLatestMap = new HashMap<>();
        this.node = node;
        this.unitPath = new ArrayList<>();
    }

}
